<!DOCTYPE html>
<html>
<head>
	<title>后台登录</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../styles/main.css">
	<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../scripts/main.js"></script>
</head>
<body>
	<div class="col-xs-offset-4 col-xs-3 login" >
		<form action="dologin" method="post">
			<div class="page-header">
				用户登录
			</div>
			<p class="unerror " style="color: red;"></p>
			<div class="form-group">
				<label for="exampleInputEmail1">用户名</label>
				<input type="text" class="form-control" name="username" placeholder="请输入用户名">
				
			</div>
			<div class="form-group">
				<label for="exampleInputPassword1">密码</label>
				<input type="password" class="form-control" name="password" placeholder="请输入密码">
				
			</div><hr>
			<button id="submit" type="submit" class="btn btn-success">登录</button>
			<!-- <a href="/users/signin" class="btn btn-info pull-right">注册</a> -->
		</form>
		<h1><a  href=" ">别找了  我把注册隐藏了  默认密码也不是admin  哈哈</a></h1>
	</div>
</body>
</html>
<script type="text/javascript">
	$(function(){
		$("#submit").click(function(){
			$.post("dologin",
				{
		      username:$("[name='username']").val(),
		      password:$("[name='password']").val()
		    },
			function(data,status){
				if (data=="OK") {
					window.location.href="/admin"
				}else{
					$('.unerror').css("display","")
					$('.unerror').text("用户名或密码错误！").fadeOut(3000);
				}
			});
			return false
		})
	})
</script>